from django.contrib import admin
from tickets.models import Ticket, Note

class NoteAdminInline(admin.StackedInline):
	model = Note
	extra = 1

class TicketAdmin(admin.ModelAdmin): 
	fieldsets = [
		(None, {'fields': ['title']}),
		('Submitter', {'fields': ['submitter_email']}),
		('Status and Priority', {'fields': ['status', 'priority'],
								'classes': ['collapse']}),
		('Description', {'fields': ['description'],
						'classes': ['collapse']}),
	]
	list_display = ('title', 'status')
	inlines = [NoteAdminInline]

admin.site.register(Ticket, TicketAdmin)
admin.site.register(Note)
